import 'package:flutter/material.dart';

class MyListTile2 extends StatelessWidget {
  Widget title;
  GestureTapCallback pressed;
  Widget trailing;
  Widget subTitle;
  double leftPadding;

  MyListTile2({Key key,
    this.pressed ,
    this.leftPadding = 0,
    @required this.subTitle,
    @required this.title,
    @required this.trailing});

  @override
  Widget build(BuildContext context) {
    return GestureDetector(
      child: Container(
        alignment: Alignment.center,
        child: Column(
          mainAxisSize: MainAxisSize.min,
          crossAxisAlignment: CrossAxisAlignment.start,
          children: <Widget>[
            Row(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              mainAxisSize: MainAxisSize.min,
              children: <Widget>[
                title,
                Padding(padding: EdgeInsets.only(left: leftPadding)),
                trailing

              ],
            ),
            subTitle

          ],
        ),
      ),
      onTap: pressed,
    );
  }
}
